package com.example.lanou.mynews.factory;

import android.support.v4.app.Fragment;

import com.example.lanou.mynews.fragment.news.NormalFrag;
import com.example.lanou.mynews.fragment.news.SecondFrag;
import com.example.lanou.mynews.fragment.news.ThirdFrag;

/**
 * Created by dllo on 16/1/21.
 */
public class FragFactory {

    /***
     * 无用，实际上只有一个frag  就是全都是listview 的fragment
     *
     * @param fragment
     * @param type
     * @param url
     * @param <T>
     * @return
     */
    public static<T> Fragment  newFrag(T fragment,int type,String url){
        if(type==1){
            return new NormalFrag(url);
        }else if(type==2){
            return new SecondFrag(url);
        }else {
            return new ThirdFrag(url);
        }
    }

}
